package com.cloud.sms.service;

import com.cloud.sms.dao.SmsHistoryMapper;
import com.cloud.sms.interceptor.ServiceException;
import com.cloud.sms.model.SmsHistory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @describe 短信发送历史
 * 
 * @author ruanpeng
 * @date 2014年7月19日
 */
@Service
public class SmsHistoryService {

	@Autowired
	private SmsHistoryMapper smsHistoryMapper;

	public int insertSelective(SmsHistory model) {
		int len = 0 ;
		try {
			len = smsHistoryMapper.insertSelective(model);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return len;
	}

	public int deleteByPrimaryKey(int id) {
		int len = 0 ;
		try {
			len = smsHistoryMapper.deleteByPrimaryKey(id);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return len;
	}

	public int updateByPrimaryKeySelective(SmsHistory model) {
		int len = 0 ;
		try {
			len = smsHistoryMapper.updateByPrimaryKeySelective(model);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return len;
	}

	public SmsHistory selectByPrimaryKey(int id) {
		return smsHistoryMapper.selectByPrimaryKey(id);
	}	

}
